<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录页面</title>
    <style>
        .auth-btn{
            width: 90%; height: 50px; line-height: 50px; text-align: center; color: #fff;
            font-size: 18px; margin: 50px auto 0 auto; background: #07c160;
        }
    </style>
    <!-- <script src="js/jquery.min.js"></script>
    <script src="js/layer/mobile/layer.js"></script> -->
</head>
<body>
    <div id='params'></div>
    <div id='unionid'></div>
</body>
</html>
<script>
   
    var appUrl = ''
    if (location.host == 'busi.xueerqin.net') {
        appUrl = 'https://app.xueerqin.net'
    } else {
        appUrl = 'https://tapp.xueerqin.net'
    }

    function getParams() {
        var search = location.search
        search = search.replace('?', '')
        var arr = search.split('&')
        var obj = {}
        for (var item of arr) {
            var list = item.split('=')
            obj[list[0]] = list[1]
        }
    
        return obj
    }

    

    var params = getParams()
    
    var url =  location.origin + location.pathname
    url = url.replace('authLoginPre', 'authLogin')

    var appid = params.appid

    location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+url+"&response_type=code&scope=snsapi_userinfo&state=STATE&component_appid=wx887b887515b4c710#wechat_redirect"
   
</script>